package com.et114.modules.cust.dao;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.components.simpletable.dao.SimpleTableDAOImpl;
import com.et114.modules.cust.vo.CustBaseVo;
import com.et114.modules.cust.vo.CustInfoVo;
import com.et114.modules.cust.vo.LeadVo;
import com.et114.modules.org.vo.UserEmplyVo;

/**
 * @author zhiweip
 * @version 1.0
 * @created 09-十一月-2010 23:03:47
 */
public class Mng_CustDaoImp  extends SimpleTableDAOImpl implements IMng_CustDao {

	public Mng_CustDaoImp(){

	}

	public void finalize() throws Throwable {

	}

	public DataList queryCustDataList(CustBaseVo vo) throws Exception{
		return this.queryListDataList ( vo , "query_custDataList" );
	}
	
	public List queryCustDownDataList(CustBaseVo vo) throws Exception{
		return this.queryList ( vo , "query_custDownDataList" );
	}
	public List query_custDownDataList_by_order(CustBaseVo vo) throws Exception{
		return this.queryList ( vo , "query_custDownDataList_by_order" );
	}
	

	public CustBaseVo loadCust(CustBaseVo vo){
		Object obj=this.load ( vo , "load_pub_custByKey" );
		return obj==null?null:(CustBaseVo)obj;
		
	}
	public LeadVo loadLeadCust(LeadVo vo){
		Object obj=this.load ( vo , "load_pub_LeadcustByKey" );
		return obj==null?null:(LeadVo)obj;
		
	}
	public List queryCustList(CustBaseVo vo){
		return this.queryList ( vo , "load_pub_custByKey" );
	}

	/**
	 * 根据类型获取客户详细资料
	 */
	public List loadCustMsgByType(CustInfoVo vo){ 
		return this.queryList ( vo , "load_pub_cust_infoByCustid" );
	}

	public Object insertCustBaseInfo(CustBaseVo vo){
		return this.insert ( vo , "insert_pub_cust" );
	}

	public int updateCustBaseInfo(CustBaseVo vo){
		return this.update ( vo , "update_pub_cust_Byid" );
	}
	public int update_pub_cust_Byid_canSetNull(CustBaseVo vo){
		return this.update ( vo , "update_pub_cust_Byid_canSetNull" );
	}
	
	public int deleteCustById(CustBaseVo vo){
		this.update ( vo , "delete_auth_usermsg_ByCustId" );
		return this.update ( vo , "delete_pub_cust_Byid" );
	}

	/**
	 * 插入客户相关信息
	 */
	public void insertCustMsg(CustInfoVo vo){
		
		 this.insert ( vo , "insert_pub_cust_info" );
	}
	public void deleteOtherCustmsg(CustInfoVo vo){
		this.delete ( vo , "delete_pub_cust_info_byType" );
	}
	
	public int deleteCust_info_byKey(CustInfoVo vo){
		return this.delete ( vo , "delete_pub_cust_info_byKey" );
	}
	public int update_pub_cust_info(CustInfoVo vo){
		return this.update ( vo , "update_pub_cust_info" );
	}
	
	/**
	 * 潜在客户
	 * @param vo
	 * @return
	 */
	public List queryLeaderIntentList(LeadVo vo){
		return this.queryList ( vo , "load_PUB_LEADER_INTENTByCustid" );
	}
	
	public Integer insert_PUB_LEADER_INTENT(LeadVo vo){
		return (Integer)this.insert ( vo , "insert_PUB_LEADER_INTENT" );
	}
	
	public void insert_PUB_LEADER_LOG(LeadVo vo){
		this.insert ( vo , "insert_PUB_LEADER_LOG" );
	}
	
	public Integer delete_PUB_LEADER_INTENT_ByLeaderid(LeadVo vo){
		return this.delete ( vo , "delete_PUB_LEADER_INTENT_ByLeaderid" );
	}

	/**
	 * 新增潜在客户跟踪信息
	 */
	public void insertLeadTrace(){

	}

	/**
	 * 新增购买意向
	 */
	public void insertLeadIntention(){

	}
	
	public DataList queryLeadDataList ( LeadVo vo ) throws Exception { 
			return this.queryListDataList(vo,"query_LeadDataList");
		
	}
	public List query_PUB_LEADER_LOG(LeadVo vo){
		return this.queryList ( vo , "query_PUB_LEADER_LOG" );
	}

	public List queryCustInfoList ( CustInfoVo vo ) {
		return this.queryList ( vo , "" );
	}
	
	public Integer insert_PUB_LEADER(LeadVo vo){
		return (Integer)this.insert ( vo , "insert_PUB_LEADER" ); 
	}
	
	public Object update_PUB_LEADER(LeadVo vo){
		return this.update ( vo , "update_PUB_LEADER" ); 
	}
	
	
	public LeadVo load_PUB_LEADER_ByKey(LeadVo vo){
		Object obj=this.load ( vo , "load_PUB_LEADER_ByKey" );
		return obj==null?null:(LeadVo)obj;
		
	}
	public List query_AllEmpList ( UserEmplyVo vo ) {
		return this.queryList ( vo , "query_AllEmpList" );
	}
	public DataList query_custOrdDataList ( CustBaseVo vo ) throws Exception { 
		return this.queryListDataList(vo,"query_custOrdDataList");
	}

	public int update_Pub_Cust_By_orderstate ( CustBaseVo vo ) {
		// TODO Auto-generated method stub
		return this.update ( vo , "update_Pub_Cust_By_orderstate" );
	}
	
	
}